﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
namespace posttrackerApi2.Models
{
    public class User
    {
        public int Id { set; get; }
        [Required]
        public string UserName { set; get; }
        [Required]
        public string Password { set; get; }
        [Required]
        public int RoleId { set; get; }
        [Required]
        public string NameSurname { set; get; }
        public int IsDeleted { set; get; }
        public DateTime LastActivityDate { set; get; }
        public bool IsLockedOut { set; get; }

        public ICollection<UserTrack> UserTracks { set; get; }
    }

    public class UserTrack
    {
        public int Id { set; get; }
        [Required]
        public int UserId { set; get; }
        [Required]
        public int TrackNumberId { set; get; }

        public User User { set; get; }
        public TrackNumber TrackNumber { set; get; }
    }
    
    public class TrackNumber
    {
        public int Id { set; get; }
        [Required]
        public string Number { set; get; }
        public ICollection<UserTrack> UserTracks { set; get; }
    }

    public class TrackData
    {
        public int Id { set; get; }
        [Required]
        public int TrackNumberId { set; get; }
        public int SourceId { set; get; }
        public string XmlDescription { set; get; }
        public string PlaceName { set; get; }
        public string State { set; get; }
        public string DateAdd { set; get; }
        public string DateFromParse { set; get; }

        public TrackNumber TrackNumber { set; get; }
        public Source Source { set; get; }
    }

    public class Source
    {
        public int Id { set; get; }
        public string Name { set; get; }
        public string Url { set; get; }
    }
}